/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package VIEW;

import BEANS.ComboItem;
import VIEW.OLD.SecondhandTradeIn;
import VIEW.InventoryUI;
import CONTROLLERS.CategoryController;
import CONTROLLERS.ProductController;
import UTIL.InputValidator;
import java.awt.event.KeyEvent;
import javax.swing.ButtonGroup;
import javax.swing.JComboBox;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Belthazod
 */
public class ProductsUI extends javax.swing.JPanel {
    static ProductController productController;
    static CategoryController categoryController;
    ButtonGroup reorderQuantityLevelGroup = new ButtonGroup();
    ButtonGroup warrantyGroup = new ButtonGroup();
    /**
     * Creates new form AddProduct
     */
    public ProductsUI() {
        initComponents();
        
        try{
        productController = new ProductController(clear, productTableSearchInput, productFilterCategoryComboBox,
                productFilterSupplierComboBox, adminProductsTable, InventoryUI.getInventoryTable(), 
                TransferUI.getTransferProductsTable(), DeliveryUI.getDeliveryProductsTable(), productsTab, 
                CriticalProducts.getCriticalProductsTable(), TradeToBrandNew.getProductsTable(), 
                AdjustmentsNew.getAdjustmentsTable(), ReplacementUI.getProductsTable(), 
                Reports.getReportsTable(), TradeToBrandNew.getMultipleProductsTable(), jComboBox1, setStatusDialog, jLabel22);
        
        adminProductsTable.getColumnModel().getColumn(0).setMaxWidth(0);
        adminProductsTable.getColumnModel().getColumn(0).setMinWidth(0);
        adminProductsTable.getColumnModel().getColumn(0).setPreferredWidth(0);

      
        editCategoryDialog.setLocationRelativeTo(null);
        editProductDialog.setLocationRelativeTo(null);
        setStatusDialog.setLocationRelativeTo(null);
        
        
        }catch(NullPointerException npe){
            npe.printStackTrace();
        }catch(Exception e){
            e.printStackTrace();
        }
        InputValidator.enabler(adminProductsTable, editProductButton);
        InputValidator.enabler(adminProductsTable, deleteProductButton);
        InputValidator.enabler(adminProductsTable, jButton7);
    
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        editProductDialog = new javax.swing.JDialog();
        jLabel8 = new javax.swing.JLabel();
        productNameEditInput = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        editProductCategoryComboBox = new javax.swing.JComboBox<ComboItem>();
        jLabel11 = new javax.swing.JLabel();
        editProductSupplierComboBox = new javax.swing.JComboBox<ComboItem>();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        quantityEditInput = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        reorderQuantityEditSpinner = new javax.swing.JSpinner();
        jButton1 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        productIDEditInput = new javax.swing.JLabel();
        productIDEditInput.setVisible(false);
        unitEditComboBox = new javax.swing.JComboBox<String>();
        jLabel19 = new javax.swing.JLabel();
        warrantyEditSpinner = new javax.swing.JSpinner();
        jLabel20 = new javax.swing.JLabel();
        editCategoryDialog = new javax.swing.JDialog();
        jLabel17 = new javax.swing.JLabel();
        categoryEditInput = new javax.swing.JTextField();
        saveEditCategoryButton = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        categoryIDEditInput = new javax.swing.JLabel();
        setStatusDialog = new javax.swing.JDialog();
        jLabel3 = new javax.swing.JLabel();
        jComboBox1 = new javax.swing.JComboBox();
        jLabel14 = new javax.swing.JLabel();
        jButton2 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jLabel16 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        productsTab = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        productNameInput = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        addProductCategoryComboBox = new javax.swing.JComboBox<ComboItem>();
        jLabel7 = new javax.swing.JLabel();
        AddProductButton = new javax.swing.JButton();
        addProductSupplierComboBox = new javax.swing.JComboBox<ComboItem>();
        filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 32767));
        warrantySpinner = new javax.swing.JSpinner();
        unitComboBox = new javax.swing.JComboBox<String>();
        jLabel18 = new javax.swing.JLabel();
        reorderQuantityLevelSpinner = new javax.swing.JSpinner();
        warrantyMonthsLabel = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        adminProductsTable = new javax.swing.JTable();
        editProductButton = new javax.swing.JButton();
        deleteProductButton = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        clear = new javax.swing.JLabel();
        productFilterSupplierComboBox = new javax.swing.JComboBox<ComboItem>();
        jLabel10 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        productFilterCategoryComboBox = new javax.swing.JComboBox<ComboItem>();
        productTableSearchInput = new javax.swing.JTextField();
        jButton7 = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();

        editProductDialog.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        editProductDialog.setTitle("Edit Product Details");
        editProductDialog.setBounds(new java.awt.Rectangle(0, 0, 500, 400));
        editProductDialog.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        editProductDialog.setModalityType(java.awt.Dialog.ModalityType.APPLICATION_MODAL);

        jLabel8.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel8.setText("Product Name:");

        productNameEditInput.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        productNameEditInput.setText("jTextField1");
        productNameEditInput.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                productNameEditInputActionPerformed(evt);
            }
        });

        jLabel9.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel9.setText("Category:");

        editProductCategoryComboBox.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N

        jLabel11.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel11.setText("Supplier:");

        editProductSupplierComboBox.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N

        jLabel12.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel12.setText("Unit:");

        jLabel13.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel13.setText("Physical Count:");

        quantityEditInput.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        quantityEditInput.setText("jLabel14");

        jLabel15.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel15.setText("Reorder Quantity Level:");

        jButton1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jButton1.setText("Cancel");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jButton3.setText("Save");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        productIDEditInput.setText("jLabel17");

        unitEditComboBox.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        unitEditComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "piece", "bottle", "box", "roll" }));

        jLabel19.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel19.setText("Warranty:");

        jLabel20.setText("months");

        javax.swing.GroupLayout editProductDialogLayout = new javax.swing.GroupLayout(editProductDialog.getContentPane());
        editProductDialog.getContentPane().setLayout(editProductDialogLayout);
        editProductDialogLayout.setHorizontalGroup(
            editProductDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(editProductDialogLayout.createSequentialGroup()
                .addGroup(editProductDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(editProductDialogLayout.createSequentialGroup()
                        .addGroup(editProductDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addGroup(editProductDialogLayout.createSequentialGroup()
                                .addContainerGap()
                                .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addGroup(editProductDialogLayout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(jLabel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                        .addGroup(editProductDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(editProductDialogLayout.createSequentialGroup()
                                .addGap(46, 46, 46)
                                .addComponent(quantityEditInput))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, editProductDialogLayout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(productNameEditInput, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(productIDEditInput))))
                    .addGroup(editProductDialogLayout.createSequentialGroup()
                        .addGroup(editProductDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(editProductDialogLayout.createSequentialGroup()
                                .addGap(260, 260, 260)
                                .addComponent(jButton3)
                                .addGap(43, 43, 43)
                                .addComponent(jButton1))
                            .addGroup(editProductDialogLayout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addGroup(editProductDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel12)
                                    .addComponent(jLabel9)
                                    .addComponent(jLabel11))
                                .addGap(44, 44, 44)
                                .addGroup(editProductDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(editProductSupplierComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(editProductCategoryComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(unitEditComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(editProductDialogLayout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addGroup(editProductDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel15)
                                    .addComponent(jLabel19))
                                .addGap(14, 14, 14)
                                .addGroup(editProductDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(editProductDialogLayout.createSequentialGroup()
                                        .addComponent(warrantyEditSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(10, 10, 10)
                                        .addComponent(jLabel20))
                                    .addComponent(reorderQuantityEditSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGap(0, 51, Short.MAX_VALUE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        editProductDialogLayout.setVerticalGroup(
            editProductDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(editProductDialogLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addGroup(editProductDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(productIDEditInput)
                    .addGroup(editProductDialogLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addGroup(editProductDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(productNameEditInput, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGap(18, 18, 18)
                .addGroup(editProductDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel12)
                    .addComponent(unitEditComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(17, 17, 17)
                .addGroup(editProductDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(editProductCategoryComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(20, 20, 20)
                .addGroup(editProductDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(editProductSupplierComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(23, 23, 23)
                .addGroup(editProductDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel13)
                    .addComponent(quantityEditInput))
                .addGap(16, 16, 16)
                .addGroup(editProductDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel15)
                    .addComponent(reorderQuantityEditSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(editProductDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(editProductDialogLayout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addComponent(jLabel19))
                    .addGroup(editProductDialogLayout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addGroup(editProductDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(warrantyEditSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel20))))
                .addGap(32, 32, 32)
                .addGroup(editProductDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton3)
                    .addComponent(jButton1))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        editCategoryDialog.setBounds(new java.awt.Rectangle(0, 0, 450, 200));

        jLabel17.setText("Category Name:");

        categoryEditInput.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                categoryEditInputKeyPressed(evt);
            }
        });

        saveEditCategoryButton.setText("Save");
        saveEditCategoryButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                saveEditCategoryButtonActionPerformed(evt);
            }
        });

        jButton6.setText("Cancel");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        categoryIDEditInput.setText("jLabel18");
        categoryIDEditInput.setEnabled(false);
        categoryIDEditInput.setVisible(false);

        javax.swing.GroupLayout editCategoryDialogLayout = new javax.swing.GroupLayout(editCategoryDialog.getContentPane());
        editCategoryDialog.getContentPane().setLayout(editCategoryDialogLayout);
        editCategoryDialogLayout.setHorizontalGroup(
            editCategoryDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(editCategoryDialogLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(editCategoryDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(editCategoryDialogLayout.createSequentialGroup()
                        .addComponent(saveEditCategoryButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton6))
                    .addGroup(editCategoryDialogLayout.createSequentialGroup()
                        .addComponent(jLabel17)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(categoryEditInput, javax.swing.GroupLayout.PREFERRED_SIZE, 274, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(60, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, editCategoryDialogLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(categoryIDEditInput)
                .addContainerGap())
        );
        editCategoryDialogLayout.setVerticalGroup(
            editCategoryDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(editCategoryDialogLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(categoryIDEditInput)
                .addGap(28, 28, 28)
                .addGroup(editCategoryDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel17)
                    .addComponent(categoryEditInput, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(40, 40, 40)
                .addGroup(editCategoryDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(saveEditCategoryButton)
                    .addComponent(jButton6))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        setStatusDialog.setTitle("Set Product Status ");
        setStatusDialog.setBounds(new java.awt.Rectangle(0, 0, 380, 250));
        setStatusDialog.setModalityType(java.awt.Dialog.ModalityType.APPLICATION_MODAL);

        jLabel3.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
        jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel3.setText("Set Status");

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "active", "inactive" }));

        jLabel14.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel14.setText("Status:");

        jButton2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jButton2.setText("OK");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton4.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jButton4.setText("Cancel");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jLabel16.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel16.setText("Product Name:");

        jLabel22.setText("jLabel22");

        javax.swing.GroupLayout setStatusDialogLayout = new javax.swing.GroupLayout(setStatusDialog.getContentPane());
        setStatusDialog.getContentPane().setLayout(setStatusDialogLayout);
        setStatusDialogLayout.setHorizontalGroup(
            setStatusDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(setStatusDialogLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
            .addGroup(setStatusDialogLayout.createSequentialGroup()
                .addGap(37, 37, 37)
                .addGroup(setStatusDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(setStatusDialogLayout.createSequentialGroup()
                        .addComponent(jButton2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton4))
                    .addGroup(setStatusDialogLayout.createSequentialGroup()
                        .addGroup(setStatusDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel16)
                            .addComponent(jLabel14))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(setStatusDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel22))))
                .addContainerGap(39, Short.MAX_VALUE))
        );
        setStatusDialogLayout.setVerticalGroup(
            setStatusDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(setStatusDialogLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel3)
                .addGap(18, 18, 18)
                .addGroup(setStatusDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel16)
                    .addComponent(jLabel22))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(setStatusDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel14))
                .addGap(38, 38, 38)
                .addGroup(setStatusDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton2)
                    .addComponent(jButton4))
                .addContainerGap(22, Short.MAX_VALUE))
        );

        setBackground(new java.awt.Color(204, 204, 204));
        setMaximumSize(new java.awt.Dimension(814, 592));
        setPreferredSize(new java.awt.Dimension(814, 592));

        productsTab.setBackground(new java.awt.Color(204, 204, 204));
        productsTab.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N

        jPanel1.setBackground(new java.awt.Color(204, 204, 204));
        jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
        jLabel1.setText("Product Name:");
        jPanel1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 20, -1, -1));

        productNameInput.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
        productNameInput.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                productNameInputActionPerformed(evt);
            }
        });
        jPanel1.add(productNameInput, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 20, 250, -1));

        jLabel4.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
        jLabel4.setText("Re- order Level:");
        jPanel1.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 190, -1, -1));

        jLabel5.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
        jLabel5.setText("Unit of measurement:");
        jPanel1.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 60, -1, -1));

        jLabel6.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
        jLabel6.setText("Category:");
        jPanel1.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 140, -1, -1));

        addProductCategoryComboBox.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
        addProductCategoryComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Accessories" }));
        addProductCategoryComboBox.setToolTipText("");
        addProductCategoryComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addProductCategoryComboBoxActionPerformed(evt);
            }
        });
        jPanel1.add(addProductCategoryComboBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 140, 250, -1));

        jLabel7.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
        jLabel7.setText("Supplier:");
        jPanel1.add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 100, -1, -1));

        AddProductButton.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        AddProductButton.setText("Add New Product");
        AddProductButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AddProductButtonActionPerformed(evt);
            }
        });
        jPanel1.add(AddProductButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 270, -1, -1));

        addProductSupplierComboBox.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
        addProductSupplierComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        addProductSupplierComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addProductSupplierComboBoxActionPerformed(evt);
            }
        });
        jPanel1.add(addProductSupplierComboBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 100, 250, -1));
        jPanel1.add(filler1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1));

        warrantySpinner.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        warrantySpinner.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(0), Integer.valueOf(0), null, Integer.valueOf(1)));
        jPanel1.add(warrantySpinner, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 230, 60, 30));

        unitComboBox.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
        unitComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "piece", "roll" }));
        unitComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                unitComboBoxActionPerformed(evt);
            }
        });
        jPanel1.add(unitComboBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 60, 129, -1));

        jLabel18.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
        jLabel18.setText("Warranty:");
        jPanel1.add(jLabel18, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 230, -1, -1));

        reorderQuantityLevelSpinner.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(0), Integer.valueOf(0), null, Integer.valueOf(1)));
        jPanel1.add(reorderQuantityLevelSpinner, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 190, 60, 30));
        reorderQuantityLevelSpinner.setVisible(true);

        warrantyMonthsLabel.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
        warrantyMonthsLabel.setText("months");
        jPanel1.add(warrantyMonthsLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 240, -1, -1));
        warrantyMonthsLabel.setVisible(false);

        productsTab.addTab("Add Product", jPanel1);

        jPanel2.setBackground(new java.awt.Color(204, 204, 204));
        jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        adminProductsTable.setAutoCreateRowSorter(true);
        adminProductsTable.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        adminProductsTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "ProductID", "Product Name", "Category", "Unit", "Supplier", "Warranty(months)", "Physical Count", "Reorder Quantity Level", "Status"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Object.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        adminProductsTable.setName(""); // NOI18N
        adminProductsTable.setRowHeight(20);
        jScrollPane1.setViewportView(adminProductsTable);
        if (adminProductsTable.getColumnModel().getColumnCount() > 0) {
            adminProductsTable.getColumnModel().getColumn(0).setResizable(false);
        }

        jPanel2.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 101, 795, 330));

        editProductButton.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        editProductButton.setText("Edit Product");
        editProductButton.setEnabled(false);
        editProductButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editProductButtonActionPerformed(evt);
            }
        });
        jPanel2.add(editProductButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 440, -1, -1));

        deleteProductButton.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        deleteProductButton.setText("Delete Product");
        deleteProductButton.setEnabled(false);
        deleteProductButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                deleteProductButtonActionPerformed(evt);
            }
        });
        jPanel2.add(deleteProductButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(680, 440, -1, -1));

        jButton5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jButton5.setText("Search");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });
        jPanel2.add(jButton5, new org.netbeans.lib.awtextra.AbsoluteConstraints(730, 60, -1, -1));

        clear.setIcon(new javax.swing.ImageIcon(getClass().getResource("/UI ICONS/xmark.png"))); // NOI18N
        clear.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                clearMouseClicked(evt);
            }
        });
        jPanel2.add(clear, new org.netbeans.lib.awtextra.AbsoluteConstraints(700, 60, -1, 26));
        clear.setVisible(false);

        productFilterSupplierComboBox.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        productFilterSupplierComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        productFilterSupplierComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                productFilterSupplierComboBoxActionPerformed(evt);
            }
        });
        jPanel2.add(productFilterSupplierComboBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 70, 170, -1));

        jLabel10.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
        jLabel10.setText("Supplier:");
        jPanel2.add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 70, -1, -1));

        jLabel21.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
        jLabel21.setText("Category:");
        jPanel2.add(jLabel21, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 40, -1, -1));

        productFilterCategoryComboBox.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        productFilterCategoryComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        productFilterCategoryComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                productFilterCategoryComboBoxActionPerformed(evt);
            }
        });
        jPanel2.add(productFilterCategoryComboBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 40, 170, -1));

        productTableSearchInput.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
        productTableSearchInput.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                productTableSearchInputKeyPressed(evt);
            }
        });
        jPanel2.add(productTableSearchInput, new org.netbeans.lib.awtextra.AbsoluteConstraints(489, 60, 230, -1));

        jButton7.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jButton7.setText("Set Status");
        jButton7.setEnabled(false);
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });
        jPanel2.add(jButton7, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 440, -1, -1));

        productsTab.addTab("Edit Product", jPanel2);

        jLabel2.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
        jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel2.setText("Products");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(productsTab, javax.swing.GroupLayout.PREFERRED_SIZE, 820, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(productsTab, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    
    private void productNameInputActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_productNameInputActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_productNameInputActionPerformed

    private void addProductSupplierComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addProductSupplierComboBoxActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_addProductSupplierComboBoxActionPerformed

    private void addProductCategoryComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addProductCategoryComboBoxActionPerformed
        // TODO add your handling code here:
        System.out.println("Selected value = " +  evt.getActionCommand());
    }//GEN-LAST:event_addProductCategoryComboBoxActionPerformed

    private void AddProductButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddProductButtonActionPerformed
        String s = "";
            String name = productNameInput.getText();
            boolean exists = false;
            for (int i=0; i<adminProductsTable.getRowCount(); i++) {    
            s = adminProductsTable.getValueAt(i, 1).toString().trim();
            if(name.equals(s)){
            exists = true;
            break;
            }
            }
            if(!exists){ 
            productController.addProduct(productNameInput, unitComboBox, addProductSupplierComboBox, addProductCategoryComboBox, reorderQuantityLevelSpinner, warrantySpinner);    
            productController.updateTableContents();
            }else{ 
            JOptionPane.showMessageDialog(null, "Item already exist.","message",JOptionPane.PLAIN_MESSAGE);
            }          
    }//GEN-LAST:event_AddProductButtonActionPerformed

    private void editProductButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editProductButtonActionPerformed
        Integer selectedRow = adminProductsTable.getSelectedRow();
        String result = (String) adminProductsTable.getModel().getValueAt(selectedRow, 0);
        productController.openProductEditDialog(result, productIDEditInput, productNameEditInput, editProductCategoryComboBox, editProductSupplierComboBox, unitEditComboBox, quantityEditInput, reorderQuantityEditSpinner, warrantyEditSpinner);
        editProductDialog.setVisible(true);
    }//GEN-LAST:event_editProductButtonActionPerformed

    private void productNameEditInputActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_productNameEditInputActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_productNameEditInputActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        productController.editProduct(editProductDialog, productIDEditInput, productNameEditInput, quantityEditInput, unitEditComboBox, editProductSupplierComboBox, editProductCategoryComboBox, reorderQuantityEditSpinner, warrantyEditSpinner);
        
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        editCategoryDialog.dispose();
    }//GEN-LAST:event_jButton6ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        editProductDialog.dispose();
    }//GEN-LAST:event_jButton1ActionPerformed

    private void deleteProductButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteProductButtonActionPerformed
        Integer selectedRow = adminProductsTable.getSelectedRow();
        String name = (String) adminProductsTable.getModel().getValueAt(selectedRow, 1);
        int result = JOptionPane.showConfirmDialog(null, "Are you sure you want to delete " + name + " from the Products List?","Warning!" ,JOptionPane.YES_NO_OPTION);
        
        if(result == 0){
            productController.deleteSelectedProduct();
        }
    }//GEN-LAST:event_deleteProductButtonActionPerformed

    private void unitComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_unitComboBoxActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_unitComboBoxActionPerformed

    private void saveEditCategoryButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveEditCategoryButtonActionPerformed
        categoryController.editCategory();
    }//GEN-LAST:event_saveEditCategoryButtonActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        productController.searchProduct();
    }//GEN-LAST:event_jButton5ActionPerformed

    private void clearMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_clearMouseClicked
        productController.clearSearch();
        //InputValidator.enabler2(cartTable, jButton2);
        // InputValidator.enabler2(cartTable, clearTableButton);
    }//GEN-LAST:event_clearMouseClicked

    private void productFilterSupplierComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_productFilterSupplierComboBoxActionPerformed
        productController.filterProducts();
    }//GEN-LAST:event_productFilterSupplierComboBoxActionPerformed

    private void productFilterCategoryComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_productFilterCategoryComboBoxActionPerformed
        productController.filterProducts();
    }//GEN-LAST:event_productFilterCategoryComboBoxActionPerformed

    private void productTableSearchInputKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_productTableSearchInputKeyPressed
        if (evt.getKeyCode()== KeyEvent.VK_ENTER)
	{
            jButton5.doClick();
	}
    }//GEN-LAST:event_productTableSearchInputKeyPressed

    private void productNameInputKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_productNameInputKeyPressed
        if (evt.getKeyCode()== KeyEvent.VK_ENTER)
	{
            AddProductButton.doClick();
	}
    }//GEN-LAST:event_productNameInputKeyPressed

    private void quantityInputKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_quantityInputKeyPressed
        if (evt.getKeyCode()== KeyEvent.VK_ENTER)
	{
            AddProductButton.doClick();
	}
    }//GEN-LAST:event_quantityInputKeyPressed

    private void categoryEditInputKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_categoryEditInputKeyPressed
        if (evt.getKeyCode()== KeyEvent.VK_ENTER)
	{
            saveEditCategoryButton.doClick();
	}
    }//GEN-LAST:event_categoryEditInputKeyPressed

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
        productController.openStatusDialog();
    }//GEN-LAST:event_jButton7ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        productController.setStatus();
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        setStatusDialog.dispose();
    }//GEN-LAST:event_jButton4ActionPerformed

    public static void updateAdminProductsTable(){
        productController.updateTableContents();
    }

    public static void updateCategoryTable(){
        categoryController.updateCategoryTable();
    }

    public static JComboBox getAddProductSupplierComboBox(){
        return addProductSupplierComboBox;
    }
    
    public static JComboBox getAddProductCategoryComboBox(){
        return addProductCategoryComboBox;
    }
    
    public static JComboBox getEditProductSupplierComboBox(){
        return editProductSupplierComboBox;
    }

    public static JComboBox<ComboItem> getProductFilterSupplierComboBox(){
        return productFilterSupplierComboBox;
    }
    
    public static JComboBox<ComboItem> getEditCategoryComboBox(){
        return editProductCategoryComboBox;
    }
    
   public static JComboBox<ComboItem> getProductFilterCategoryComboBox(){
       return productFilterCategoryComboBox;
   }
        
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton AddProductButton;
    private static javax.swing.JComboBox<ComboItem> addProductCategoryComboBox;
    private static javax.swing.JComboBox<ComboItem> addProductSupplierComboBox;
    private static javax.swing.JTable adminProductsTable;
    private javax.swing.JTextField categoryEditInput;
    private javax.swing.JLabel categoryIDEditInput;
    private javax.swing.JLabel clear;
    private javax.swing.JButton deleteProductButton;
    private javax.swing.JDialog editCategoryDialog;
    private javax.swing.JButton editProductButton;
    private static javax.swing.JComboBox<ComboItem> editProductCategoryComboBox;
    private javax.swing.JDialog editProductDialog;
    private static javax.swing.JComboBox<ComboItem> editProductSupplierComboBox;
    private javax.swing.Box.Filler filler1;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private static javax.swing.JComboBox<ComboItem> productFilterCategoryComboBox;
    private static javax.swing.JComboBox<ComboItem> productFilterSupplierComboBox;
    private javax.swing.JLabel productIDEditInput;
    private javax.swing.JTextField productNameEditInput;
    private javax.swing.JTextField productNameInput;
    private javax.swing.JTextField productTableSearchInput;
    private javax.swing.JTabbedPane productsTab;
    private javax.swing.JLabel quantityEditInput;
    private javax.swing.JSpinner reorderQuantityEditSpinner;
    private javax.swing.JSpinner reorderQuantityLevelSpinner;
    private javax.swing.JButton saveEditCategoryButton;
    private javax.swing.JDialog setStatusDialog;
    private javax.swing.JComboBox<String> unitComboBox;
    private javax.swing.JComboBox<String> unitEditComboBox;
    private javax.swing.JSpinner warrantyEditSpinner;
    private javax.swing.JLabel warrantyMonthsLabel;
    private javax.swing.JSpinner warrantySpinner;
    // End of variables declaration//GEN-END:variables
}
